import vue from "vue"
import vueRouter from "vue-router"
import routes from "./routes"

vue.use(vueRouter);

//路由
const router = new vueRouter({
    //mode:'history',
    base: __dirname,
    scrollBehavior (to, from, savedPosition) {
        if (savedPosition) {
            return savedPosition
        } else {
            return { x: 0, y: 0 }
        }
    },
    routes
})

export default router
